home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Mania 4
/
MacMania 4.toast
/
/
Demo's
/
Igor Demo Pro
/
1 PutContentsIn Igor Pro Folder
/
WaveMetrics Procedures
/
Utilities
/
String Utilities
/
String Substitution
< prev
next >
Wrap
Text File
|
1994-02-18
|
468b
|
21 lines
| <String Substitution>
|
| returns theStr with all instances of srcPat in theStr replaced with destPat
| note: Search is case sensitive
Function/S StrSubstitute(srcPat,theStr,destPat)
String srcPat,theStr,destPat
Variable sstart=0,sstop,srcLen= strlen(srcPat), destLen= strlen(destPat)
do
sstop= strsearch(theStr, srcPat, sstart)
if( sstop < 0 )
break
endif
theStr[sstop,sstop+srcLen-1]= destPat
sstart= sstop+destLen
while(1)
return theStr
End